package com.slaffka.model.user;

/**
 * Created by IntelliJ IDEA.
 * User: v.tsapaev
 * Date: 16.03.12
 * Time: 23:35
 * To change this template use File | Settings | File Templates.
 */
public class UserDTO {

    private Long userId;

    private String username;

    public UserDTO(Long userId, String username) {
        this.userId = userId;
        this.username = username;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }
    
    public static UserDTO convertToDTO(User user){
        if (user == null) return null;
        return new UserDTO(user.getUserId(), user.getUsername());
    }
}
